#include "stdafx.h"
#ifdef _DEBUG
	#undef THIS_FILE
	static char THIS_FILE[] = __FILE__;
	#undef DEBUG_NEW
	#define	DEBUG_NEW new(_NORMAL_BLOCK,__FILE__,__LINE__)
	#define new DEBUG_NEW
#endif
/////////////////////////////////////////////////////////////////////////////
zwl_vector::zwl_vector(void):_items(NULL)
{
}

zwl_vector::~zwl_vector(void)
{
	zwl_vector::ReleaseAll();
}
/////////////////////////////////////////////////////////////////////////////
LPSTR zwl_vector::Malloc(DWORD dwSize)
{
	PITEM pItem=new ITEM;
	if(pItem)
	{
		if(pItem->lpData=zwl_memory_malloc(dwSize))
		{
			pItem->pNext = _items;
			_items = pItem;
			return(pItem->lpData);
		}
		delete pItem;
	}
	return(NULL);
}

void zwl_vector::ReleaseAll(void)
{
	for(PITEM pNext=NULL;_items;_items=pNext)
	{
		pNext = _items->pNext;
		zwl_memory_release(_items->lpData);
		delete _items;
	}
}
